using Gobang;
using Services;
using Services.Event;
using UnityEngine;

public class MessageUI : MonoBehaviour
{
    protected PredictionManager manager;
    protected GameManager gameManager;
    protected ChessboardMono chessboard;
    protected IEventSystem eventSystem;

    protected virtual void AfterGameStateChange(bool isPlaying)
    {

    }

    protected virtual void AfterChessChange()
    {

    }

    protected virtual void Awake()
    {
        eventSystem = ServiceLocator.Get<IEventSystem>();
        gameManager = ServiceLocator.Get<GameManager>();
        manager = PredictionManager.FindInstance();
        chessboard = ChessboardMono.FindInstance();
    }

    protected virtual void OnEnable()
    {
        eventSystem.AddListener<bool>(EEvent.AfterGameStateChange, AfterGameStateChange);
        chessboard.AfterChessChange += AfterChessChange;
    }

    protected virtual void OnDisable()
    {
        eventSystem.RemoveListener<bool>(EEvent.AfterGameStateChange, AfterGameStateChange);
        chessboard.AfterChessChange -= AfterChessChange;
    }
}
